fin = open('../data/allpossiblesessions.dat','r')
line = fin.readline()

healthywords = set()
for l in open('../ref/6Diseases.dict').readlines():
    healthywords.add(l.strip())
    
while line != '':
    tag = 'EMPTY'
    for w in healthywords:
        if w in line:
            tag = w
    
    segs = line.strip().replace('\t\t','\t').split('\t')
    cookie = segs[0]
    fout = open('../result/cookies/'+cookie+'.txt','a')
    fout.write(tag+'\t'+line.strip()+'\n')
    line = fin.readline()
fin.close()
fout.close()
